package com.touni.designpattern.commandpattern;

import java.util.ArrayList;
import java.util.List;

/**
 * @ClassName : Orders
 * @Description :
 * @Author : lwq
 * @Date: 2020-11-21 09:53
 */
public class Orders {
    private List<Order> orders = new ArrayList<>();

    public void addOrder(Order order){
        orders.add(order);
    }

    public void takeOrder(){
        orders.stream().forEach(Order::execute);
    }
}
